
/**
 * Created by zhangbo on 18/12/17.
 */
//var AirportService = (function () {
//	 function Service(cesiumViewer, opt) {
//		 
//	 }
//	 return Service;
//})();
(function () {
	var AirportService = {
			URLs:{
				SB:{
					DPC:{
						queryUrl: '/rest/sb/dpc/selectAll',
						insertUrl: '/rest/sb/dpc/insert',
						updateUrl: '/rest/sb/dpc/updateById',
						saveUrl: '/rest/sb/dpc/save',
						deleteByIdUrl: '/rest/sb/dpc/deleteById',
					},
					MHQ:{
						queryUrl: '/rest/sb/mhq/selectAll',
						insertUrl: '/rest/sb/mhq/insert',
						updateUrl: '/rest/sb/mhq/updateById',
						saveUrl: '/rest/sb/mhq/save',
						deleteByIdUrl: '/rest/sb/mhq/deleteById',
					},
					QNC:{
						queryUrl: '/rest/sb/qnc/selectAll',
						insertUrl: '/rest/sb/qnc/insert',
						updateUrl: '/rest/sb/qnc/updateById',
						saveUrl: '/rest/sb/qnc/save',
						deleteByIdUrl: '/rest/sb/qnc/deleteById',
					},
					XFC:{
						queryUrl: '/rest/sb/xfc/selectAll',
						insertUrl: '/rest/sb/xfc/insert',
						updateUrl: '/rest/sb/xfc/updateById',
						saveUrl: '/rest/sb/xfc/save',
						deleteByIdUrl: '/rest/sb/xfc/deleteById',
					},
					XFSC:{
						queryUrl: '/rest/sb/xfsc/selectAll',
						insertUrl: '/rest/sb/xfsc/insert',
						updateUrl: '/rest/sb/xfsc/updateById',
						saveUrl: '/rest/sb/xfsc/save',
						deleteByIdUrl: '/rest/sb/xfsc/deleteById',
					},
					XFS:{
						queryUrl: '/rest/sb/xfs/selectAll',
						insertUrl: '/rest/sb/xfs/insert',
						updateUrl: '/rest/sb/xfs/updateById',
						saveUrl: '/rest/sb/xfs/save',
						deleteByIdUrl: '/rest/sb/xfs/deleteById',
					},
					ZLW:{
						queryUrl: '/rest/sb/zlw/selectAll',
						insertUrl: '/rest/sb/zlw/insert',
						updateUrl: '/rest/sb/zlw/updateById',
						saveUrl: '/rest/sb/zlw/save',
						deleteByIdUrl: '/rest/sb/zlw/deleteById',
					},
				},
				QT:{
					MYXX: {
						getAllUrl: '/rest/qt/myxx/selectAll',
						getNamesUrl: '/rest/qt/myxx/selectNames',
						getByIdUrl: '/rest/qt/myxx/selectById',
						saveUrl: '/rest/qt/myxx/save',
						deleteByIdUrl: '/rest/qt/myxx/deleteById',
						deleteByIdsUrl: '/rest/qt/myxx/deleteByIds',
					},
					MX: {
						queryUrl: '/rest/qt/mx/selectAll',
						getByIdUrl: 'rest/qt/mx/getModuleById'
					}
				}
			},
			billboard:{
				SB:{
					DPC:'',
					MHQ:'',
					QNC:'',
					XFC:'',
					XFSC:'',
					XFS:'data/billboard/hydrant32.png',
					ZLW:'',
					SXJ:'data/billboard/shexiangji_24_24.png',
				}
			},
			model:{
				SB:{
					DPC:'',
					MHQ:'',
					QNC:'',
					XFC:'data/model/xfc.glb',
					XFSC:'',
					XFS:'',
					ZLW:'',
				}
			},
			asyncQueryPost: function(url, param, cb){
				$.ajax({
			        url: url,
			        type: "POST",
			        data: JSON.stringify(param),
				    dataType: "json",
				    contentType: "application/json",
				    success: function(d){
				        if(d.code === 0){
				        	cb(d);
				        }
				        else if(Number(d) !== 0){
				        	cb(d);
				        }
				        else {
				        	alert(d.msg);
				        }
				    }
				});
			},
			asyncQueryGet: function(url, cb){
				$.ajax({
			        url: url,
			        type: "GET",
				    success: function(d){
				        if(d.code === 0){
				        	cb(d);
				        }
				        else if(Number(d) !== 0){
				        	cb(d);
				        }
				        else {
				        	alert(d.msg);
				        }
				    }
				});
			}
		};
	window.AirportService = AirportService;
})();
